package user;

import operation.*;

import java.util.Scanner;

//普通用户
public class NormalUser extends User{
    public NormalUser(String name) {
        super(name);
//       就把普通用户的操作，存储到这个接口数组当中
        this.iOperations = new IOperation[] {
                new ExitOperation(),
                new FindQperation(),
                new BorrowOperation(),
                new ReturnOperation()
        };
        //第三种数组的定义方式：int[] arr = new int[]{1,2,3,4,5};
//        int[] arr;
//        public void func(){
//            this.arr = new int[]{1,2,3,4};
//        }
    }
    public int menu(){
        System.out.println("=========普通用户菜单！==========");
        Scanner scanner = new Scanner(System.in);
        System.out.println("hello!! "+super.name+"，欢迎来到图书管理系统");
        System.out.println("1、查找图书");
        System.out.println("2、借阅图书");
        System.out.println("3、归还图书");
        System.out.println("0、退出系统");
        System.out.println("===============================");
        int choice = scanner.nextInt();
        return choice;
    }
}
